package com.jd.jobkeeper.server.service;

import com.jd.jobkeeper.server.data.entity.ServerInfo;

import java.util.List;

public interface ServerInfoService {

    boolean isSelf(String serverId);

    boolean isAlive(String serverId);

    long getHealthThreshold();

    /**
     * Return Current server information
     * @return
     */
    ServerInfo currentServer();

    /**
     * Get All Server Info
     * @return
     */
    List<ServerInfo> findAll();

    /***
     * Register current server
     */
    void register();

    /**
     * Unregister current Server
     */
    void unregister();

    /**
     * Update current server heart beat time
     */
    void heartBeat();
}
